package com.demo.spring.test;


import com.demo.spring.dao.UserDao;
import com.demo.spring.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringTest01 {

   @Test
    public void saveTest(){
       //将对象加载到spring容器中
       ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
       UserService UserService = (UserService) applicationContext.getBean("userSerivce");
       UserService.save();
   }
}
